-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Importer bug fixes #327
Merged
Merged
Importer bug fixes #327
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
src/unihan_db/importer.py:75: in import_char assert isinstance(kci, dict) E AssertionError c = <unihan_db.tables.Unhn object at 0x7faab7c60dd0> char = {'char': '一', 'kCCCII': ['213021'], 'kCangjie': 'M', 'kCantonese': ['jat1'], ...} kc = 'jat1' kci = '213021' kd = 'alone'
unihan-db/src/unihan_db/importer.py:254: in import_char assert isinstance(_khp['location'], dict) E KeyError: 'location' _kaj = {'cid': 1200, 'radical': 1, 'strokes': 1, 'strokes-residue': 0, ...} _kct = {'character': 1, 'page': 1, 'row': 1} _kdj = {'character': 1, 'page': 129, 'virtual': 0} _kf = {'frequency': 'A', 'phonetic': '1'} _khp = {'frequency': 32747, 'phonetic': 'yī'} _khy = {'character': 1, 'page': 1, 'virtual': 0, 'volume': 1} _kidj = {'character': 1, 'page': 129, 'virtual': 0} _kidj_locations = [<unihan_db.tables.UnhnLocation object at 0x7fb8aafb5880>] _kiic = {'priority': 'A', 'sources': ['G', 'T', 'J', 'H', 'K', 'M', ...]} _kiic_source = 'P' _kikx = {'character': 1, 'page': 75, 'virtual': 0} _kikx_locations = [<unihan_db.tables.UnhnLocation object at 0x7fb8aafb5820>] c = <unihan_db.tables.Unhn object at 0x7fb8aafb4dd0> char = {'char': '一', 'kCCCII': ['213021'], 'kCangjie': 'M', 'kCantonese': ['jat1'], ...} k_sources = [<unihan_db.tables.kIICoreSource object at 0x7fb8aafb5640>, <unihan_db.tables.kIICoreSource object at 0x7fb8aafb56d0>,...ihan_db.tables.kIICoreSource object at 0x7fb8aafb5760>, <unihan_db.tables.kIICoreSource object at 0x7fb8aafb5790>, ...] kc = 'jat1' kci = '213021' kd = 'alone' khp_locations = [<unihan_db.tables.UnhnLocation object at 0x7fb8aafb5310>] khp_readings = [<unihan_db.tables.UnhnReading object at 0x7fb8aafb5340>] khy_locations = [<unihan_db.tables.UnhnLocation object at 0x7fb8aafb5400>] km = {'zh-Hans': 'yī', 'zh-Hant': 'yī'} kts = {'zh-Hans': 1, 'zh-Hant': 1} kxhc = {'locations': [{'character': 16, 'entry': 0, 'page': 1368, 'substituted': False}], 'reading': 'yì'} kxhc_locations = [<unihan_db.tables.UnhnLocationkXHC1983 object at 0x7fb8aafb5550>] loc = {'character': 16, 'entry': 0, 'page': 1368, 'substituted': False} reading = 'yī'
python3.12/site-packages/sqlalchemy/orm/relationships.py:1536: in cascade_iterator raise AssertionError( E AssertionError: Attribute 'locations' on class '<class 'unihan_db.tables.GenericReading'>' doesn't handle objects of type '<class 'unihan_db.tables.UnhnReading'>' c = <unihan_db.tables.UnhnReading object at 0x7f55ed9a1af0> dict_ = {'_sa_instance_state': <sqlalchemy.orm.state.InstanceState object at 0x7f55ecd617f0>, 'locations': [<unihan_db.tables....ect at 0x7f55ed9a1af0>], 'readings': [<unihan_db.tables.UnhnReading object at 0x7f55ed9a1af0>], 'type': 'kHanyuPinyin'} halt_on = <bound method Session._contains_state of <sqlalchemy.orm.session.Session object at 0x7f55f124d190>> instance_dict = {'_sa_instance_state': <sqlalchemy.orm.state.InstanceState object at 0x7f55ecd61af0>, 'reading': 'tiàn'} instance_mapper = <Mapper at 0x7f55f1b9dee0; UnhnReading> instance_state = <sqlalchemy.orm.state.InstanceState object at 0x7f55ecd61af0> passive = symbol('PASSIVE_NO_INITIALIZE') self = <Relationship at 0x7f55f1cedc70; locations> skip_pending = False state = <sqlalchemy.orm.state.InstanceState object at 0x7f55ecd617f0> tuples = [(<sqlalchemy.orm.state.InstanceState object at 0x7f55ecd61af0>, <unihan_db.tables.UnhnReading object at 0x7f55ed9a1af0>)] type_ = 'save-update' visited_states = {<sqlalchemy.orm.state.InstanceState object at 0x7f55ecd61c10>, <sqlalchemy.orm.state.InstanceState object at 0x7f55ec....orm.state.InstanceState object at 0x7f55ecd61970>, <sqlalchemy.orm.state.InstanceState object at 0x7f55ecd61d90>, ...}
lib/python3.12/site-packages/sqlalchemy/orm/relationships.py:1536: in cascade_iterator raise AssertionError( E AssertionError: Attribute 'readings' on class '<class 'unihan_db.tables.GenericReading'>' doesn't handle objects of type '<class 'unihan_db.tables.UnhnLocationkXHC1983'>' c = <unihan_db.tables.UnhnLocationkXHC1983 object at 0x7f70eef2c5c0> dict_ = {'_sa_instance_state': <sqlalchemy.orm.state.InstanceState object at 0x7f70e18e62d0>, 'readings': [<unihan_db.tables.UnhnLocationkXHC1983 object at 0x7f70eef2c5c0>], 'type': 'kXHC1983'} halt_on = <bound method Session._contains_state of <sqlalchemy.orm.session.Session object at 0x7f70f26a5a30>> instance_dict = {'_sa_instance_state': <sqlalchemy.orm.state.InstanceState object at 0x7f70e18e6210>, 'character': 16, 'entry': 0, 'page': 1506, ...} instance_mapper = <Mapper at 0x7f70f2ff1550; UnhnLocationkXHC1983> instance_state = <sqlalchemy.orm.state.InstanceState object at 0x7f70e18e6210> passive = symbol('PASSIVE_NO_INITIALIZE') self = <Relationship at 0x7f70f3145d10; readings> skip_pending = False state = <sqlalchemy.orm.state.InstanceState object at 0x7f70e18e62d0> tuples = [(<sqlalchemy.orm.state.InstanceState object at 0x7f70e18e6210>, <unihan_db.tables.UnhnLocationkXHC1983 object at 0x7f70eef2c5c0>)] type_ = 'save-update' visited_states = {<sqlalchemy.orm.state.InstanceState object at 0x7f70e18e6030>, <sqlalchemy.orm.state.InstanceState object at 0x7f70e1....orm.state.InstanceState object at 0x7f70e18e6390>, <sqlalchemy.orm.state.InstanceState object at 0x7f70e18e5d30>, ...}
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #327 +/- ##
==========================================
+ Coverage 69.77% 69.87% +0.10%
==========================================
Files 9 9
Lines 655 654 -1
Branches 88 88
==========================================
Hits 457 457
+ Misses 192 191 -1
Partials 6 6 ☔ View full report in Codecov by Sentry. |
tony
force-pushed
the
importer-bug-fixes
branch
from
December 10, 2023 15:00
777336d
to
aa7c268
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Cherry-picked out of #324
Fix imports for
kXHC1983
,kHanyuPinyin
,kHanyuPinlu
,kCCCII